package Example18;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();

        int diff=Math.abs(a-b);
        int c=1,d=1;
        boolean isFind=false;
        for (c=1;c<diff && !isFind;c++){
            for (d=1;d<diff && !isFind;d++){
                if((c+d)*Math.abs((c-d))==diff)
                    isFind=true;
            }
        }
        c--;
        int k=(int)Math.pow(c,2)-a;
        System.out.println(k);
    }
}
